package com.active.service.impl;

import com.active.dao.ActiveWisdomMapper;
import com.active.service.IActiveWisdomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ActiveWisdomServiceImpl implements IActiveWisdomService {

    @Autowired
    private ActiveWisdomMapper activeWisdomMapper;

    @Override
    @Transactional(readOnly = false)
    public int insert(com.active.bean.ActiveWisdom activeWisdom) {
        return activeWisdomMapper.insert(activeWisdom);
    }

    @Override
    @Transactional(readOnly = false)
    public int updateByPrimaryKey(com.active.bean.ActiveWisdom activeWisdom) {
        return activeWisdomMapper.updateByPrimaryKey(activeWisdom);
    }

    @Override
    @Transactional(readOnly = true)
    public List<com.active.bean.ActiveWisdom> selectRandomRecord(Integer num) {
        return activeWisdomMapper.selectRandomRecord(num);
    }

    @Override
    @Transactional(readOnly = false)
    public int deleteByPrimaryKey(Integer id) {
        return activeWisdomMapper.deleteByPrimaryKey(id);
    }
}
